#pragma once

typedef struct _RectInfo
{
	CWnd*		wnd;
	DWORD		flag;
	float		ftop;
	float		fleft;
	float		fbottom;
	float		fright;
	CRect		rect;
	_RectInfo*	pnext;

	_RectInfo()
	{
		ZeroMemory(&rect, sizeof(rect));
		ftop = 0.0;
		fleft = 0.0;
		fbottom = 0.0;
		fright = 0.0;
		pnext = NULL;
		wnd = NULL;
		flag = 0;
	}
}RectInfo, *pRectInfo;



class CWndResize
{
public:
	CWndResize(void);
	~CWndResize(void);	

	
	void		InitWndSize(float width, float height);
	BOOL		Resize(CWnd* wnd, float width, float height,  CRect* rect, CWnd* parent, DWORD flag);
	void		ResetWndSize(float width, float height);

private:
	CCriticalSection	_locker;
	float				_oldWidth;
	float				_oldHeight;
	RectInfo*			_pHeader;

	void		AddRectInfo(RectInfo* info);
	RectInfo*	FindRectInfo(DWORD flag);
	RectInfo*	AddWnd(CWnd* wnd, CWnd* parent, DWORD flag);
	
	
};

